package com.world.tg.result;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@ApiModel("响应数据")
public class JsonResult extends BaseResult{
    @ApiModelProperty("数据对象")
    private Object data;

    public void success(String msg, Object data){
        super.setCode(200);
        super.setMsg(msg);
        this.data = data;
    }

    public void fail(String msg,Object data){
        super.setCode(0);
        super.setMsg(msg);
        this.data = data;
    }
}
